﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using System.Data.SqlClient;
using System.Configuration;

namespace EMR
{
    public class SqlHelperDapper
    {
        private static  SqlConnection sqlConnection = new SqlConnection(SqlHelper.ConnStrings);
        public  string ConnStrings
        {
            get
            {
                return ConfigurationManager.ConnectionStrings["sqlserver"].ConnectionString;
            }
        }
        
        public static  T GetScalar<T>(string CommandText ,object parameter )
        {
            return sqlConnection.Query<T>(CommandText, parameter).FirstOrDefault();
        }
       

    }
}
